package com.youaishujuhui.devops.web.service.game;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.nutz.dao.Dao;
import org.nutz.service.IdEntityService;
import org.springframework.stereotype.Service;

import com.youaishujuhui.devops.web.domain.game.Department;
import com.youaishujuhui.devops.web.po.DepartmentPO;

@Service
public class DepartmentService extends IdEntityService<Department> {

	public List<DepartmentPO> queryAll() {
		List<Department> list = this.query();
		List<DepartmentPO> poList = new ArrayList<DepartmentPO>();
		
		if (list != null) {
			for (Department d : list) {
				DepartmentPO po = new DepartmentPO();
				po.setId(d.getDeptId());
				po.setText(d.getName());
				poList.add(po);
			}
		}
		
		return poList;
	}
	
	@Resource(name = "nutDao")
	@Override
	public void setDao(Dao dao) {
		super.setDao(dao);
	}
}
